/**客户管理-客户信息API**/
import obj from '@/utils/request'

let {request, baseURL} = obj

//查询所有客户信息
export function getCustomer(data) {
  return request({
    url: '/customerInfo/page',
    method: 'post',
    data
  })
}

//添加客户信息
export function addCustomer(data) {
  return request({
    url: '/customerInfo',
    method: 'post',
    data
  })
}

//添加客户信息时生成的客户号
export function getCustomerNum() {
  return request({
    url: '/customerInfo/customerNum',
    method: 'get',
  })
}

//根据客户号查询客户信息
export function getCustomerInfoById(id) {
  return request({
    url: '/customerInfo/' + id,
    method: 'get',
  })
}

//修改客户信息
export function modCustomer(data) {
  return request({
    url: '/customerInfo',
    method: 'put',
    data
  })
}

//删除客户信息
export function delCustomer(data) {
  return request({
    url: '/customerInfo',
    method: 'delete',
    data
  })
}

//禁用启用客户
export function disableOrEnableCustomer(stores, params) {
  return request({
    url: '/customerInfo/disableOrEnable',
    method: 'put',
    data: stores,
    params
  })
}

//根据客户查询 客户收件列表
export function getSenderList(customerNum) {
  return request({
    url: '/customerInfo/' + customerNum,
    method: 'get',
  })
}

export function resetPassword(data) {
  return request({
    url: '/customerInfo/resetPassword',
    method: 'put',
    data: data
  })
}
